home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Source Code / Add-Ons / MPW / MPW re2c 1.1 / scanner.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-06-01  |  575 b   |  36 lines  |  [TEXT/KAHL]

  1. #ifndef _scanner_h
  2. #define    _scanner_h
  3.  
  4. // $Log: scanner.h,v $
  5. //Revision 1.1  1994/04/08  15:27:59  peter
  6. //Initial revision
  7. //
  8.  
  9. #include "token.h"
  10.  
  11. class Scanner {
  12.   private:
  13.     int            in;
  14.     uchar        *bot, *tok, *ptr, *cur, *pos, *lim, *top, *eof;
  15.     uint        tchar, tline, cline;
  16.   private:
  17.     uchar *fill(uchar*);
  18.   public:
  19.     Scanner(int);
  20.     int echo(ostream&);
  21.     int scan();
  22.     void fatal(char*);
  23.     SubStr token();
  24.     uint line();
  25. };
  26.  
  27. inline SubStr Scanner::token(){
  28.     return SubStr(tok, cur - tok);
  29. }
  30.  
  31. inline uint Scanner::line(){
  32.     return cline;
  33. }
  34.  
  35. #endif
  36.